<script lang="ts" setup>
import type { DialogModelFlowable } from '@/index.d';

const dialogModel = defineModel<DialogModelFlowable>('processInstanceChooseDialogModel', {
  required: true
});

interface DataType {
  id: number;
  project: string;
  customer: string;
  production: string;
  technique: string;
  taskName: string;
  status: string;
  processInstanceName: string;
  createTime: string;
  endTime: string;
}

const data: Array<DataType> = [];
onMounted(() => {
  data.push({
    id: 1,
    project: 'CX项目3、4号',
    customer: '中国核电工程',
    production: '稳压器',
    technique: '中核华龙一号',
    taskName: '技术员维护',
    status: '进行中',
    processInstanceName: '产品报价流程',
    createTime: '2024-07-29 09:14:48',
    endTime: ''
  });
  data.push({
    id: 2,
    project: 'CX项目3、4号',
    customer: '中国核电工程',
    production: '稳压器支承',
    technique: '中核华龙一号',
    taskName: '科室主任审批',
    status: '进行中',
    processInstanceName: '产品报价流程',
    createTime: '2024-07-29 09:14:46',
    endTime: ''
  });
  data.push({
    id: 3,
    project: '后处理项目陶',
    customer: '中国核电工程',
    production: '稳压器',
    technique: '通用产品',
    taskName: '采购/外协员维护',
    status: '进行中',
    processInstanceName: '产品报价流程',
    createTime: '2024-07-23 11:32:02',
    endTime: ''
  });
  data.push({
    id: 4,
    project: '一体化快堆余',
    customer: '中国原子能科',
    production: '余热排出热交换器',
    technique: 'CAP1400',
    taskName: '技术员维护',
    status: '进行中',
    processInstanceName: '产品报价流程',
    createTime: '2024-07-04 17:25:53',
    endTime: ''
  });
  data.push({
    id: 5,
    project: '一体化快堆余',
    customer: '中国原子能科',
    production: '通用产品',
    technique: '其它',
    taskName: '技术员维护',
    status: '进行中',
    processInstanceName: '产品报价流程',
    createTime: '2024-07-04 17:25:53',
    endTime: ''
  });
});
</script>
<template>
  <hq-dialog-table-flowable v-model:dialog-model="dialogModel">
    <template #header> 选择您需要催办的流程（列出我发起的流程）</template>
    <template #default>
      <el-button type="primary">确认催办</el-button>
      <br />
      <br />
      <el-table :data size="large" border>
        <el-table-column type="selection" :min-width="50" align="center" />
        <hq-table-column label="项目名称" prop="project" :min-width="100" />
        <hq-table-column label="客户名称" prop="customer" :min-width="100" />
        <hq-table-column label="产品名称" prop="production" :min-width="100" />
        <hq-table-column label="技术路线" prop="technique" :min-width="100" />
        <hq-table-column label="当前任务" prop="taskName" :min-width="100" />
        <hq-table-column label="状态" :min-width="100">
          <template #default="{ row }">
            <el-text type="success">{{ row.status }}</el-text>
          </template>
        </hq-table-column>
        <hq-table-column label="流程名称" prop="processInstanceName" :min-width="100" />
        <hq-table-column label="创建时间" prop="createTime" :min-width="100" />
        <hq-table-column label="结束时间" prop="endTime" :min-width="100" />
      </el-table>
    </template>
  </hq-dialog-table-flowable>
</template>
<style lang="scss" scoped>
:deep(tr) {
  height: 60px;
}
</style>
